package com.jlcindia.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Lab35 {
	public static void main(String[] args) {
		ApplicationContext ctx=new ClassPathXmlApplicationContext("jlcindia.xml");
		System.out.println("********* Using Autoproxy and concept of PointCuts and Advices **********");
		CustomerService cst=(CustomerService)ctx.getBean("cs");
		cst.addCustomer();
		System.out.println("-----------------------\n");
		cst.updateCustomer();
		System.out.println("-----------------------\n");
		AccountService ast=(AccountService)ctx.getBean("as");
		ast.mydeposit();
		System.out.println("-----------------------\n");
		ast.getBal();
		System.out.println("-----------------------\n");
		try{
			ast.withdraw();
		}catch(Exception e){
			System.out.println("Sorry...");
		}
	}
}
